<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>
		<style type="text/css">
			.btn-success,.btn-warning{padding: 3px 10px;margin: 0 5px;}
		</style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>材料供应查询统计</h2></div>
				<div class="col-xs-2 text-right"><a href="#"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl id="list" class="erp-list">
				</dl>
                <!--<div class="showlists">暂无更多数据</div>-->
			</div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" id="mname" class="pro pro-input pro-name" placeholder="请输入项目名称"/>
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test01" name="supply_Time" placeholder="请输入开始时间">

								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test02" name="supply_Time" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
                            <input class="sub-cover btns fr" type="button" onclick="data(1,10);" value="确定" />
							
						</div>
						
					</form>
				
				</div>
				
			</div>
			
			
			
			
			
			
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="UTF-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test01'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#test02'
            ,type: 'datetime'
        });
    })


	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();

	});

//	点击取消按钮
	$(".close-cover").click(function(){
		$(".search-box").slideUp();
	});
    //	点击确定按钮
    $(".sub-cover").click(function(){
        $('.erp-list').html('');
        $(".search-box").slideUp();
        formData.mname=$('#mname').val();
        formData.begintime=$('#test01').val();
        formData.endtime = $('#test02').val();
        nloader.search();
    });

    var formData = {
        type:'a'
    };
    //滚动加载
    var nloader = LoadMore({
        api: 'api/supply/materialGySelList.do',
        data: formData,
        success: function (data) {
            var json=data.data;
//            if(json.length==0){
//                $('.showlists').show();
//            }else{
//                $('.showlists').hide();
//            }
            for(var i=0;i<json.length;i++){
                if(json[i].validate == -1){
                    json[i].validate='等待签收';
                }
                if(json[i].validate == 0){
                    json[i].validate='签收完成';
                }
                if (json[i].validate == 1){
                    json[i].validate='拒绝签收';
                }
                $('#list').append('<dd><a href="erp-details.html?'+json[i].rm_Code+'" ><h3><span class="btn btn-danger fr">'+json[i].validate+'</span>' +
                    json[i].rm_Code +
                    '</h3>' +
                    '<div class="erp-txt visa-txt">' +
                    '<p class="clearfix"><span class="sp">项目名称:</span><span class="divCon">'+json[i].proName+'</span></p>' +
                    '<p class="clearfix"><span class="sp">施工单位:</span><span class="divCon">'+json[i].compName1+'</span></p>' +
                    '<p class="clearfix"><span class="sp">供货商名称:</span><span class="divCon">'+json[i].supName+'</span></p>' +
                    '<p class="clearfix"><span class="sp">送货地址:</span><span class="divCon">'+json[i].r_adr+'</span></p>' +
                    '</div>' +
                    '</a>' +
                    '</dd>');
            }
        }
    })




//
//	var jsondata;
//
//    function data(currPage, pageSize) {
//
//
//        var sendData = {'type':'a'};
//
//        var beginDate = $('#test01').val();
//        var endDate = $('#test02').val();
//        var mname = $('#mname').val();
//
//
//        sendData['p'] = getP();
//
//        if(beginDate != '' && beginDate != undefined){
//            sendData['begintime'] = beginDate;
//        }
//        if(endDate != '' && endDate != undefined){
//            sendData['endtime'] = endDate;
//        }
//        if (mname != '' && mname != undefined){
//            sendData['mname'] = mname;
//        }
//
//        if (currPage != undefined && currPage!='' && currPage != 0){
//            sendData['currPage'] = currPage;
//        }else {
//            sendData['currPage'] = 1;
//        }
//
//        if (pageSize != undefined && pageSize!='' && pageSize != 0){
//            sendData['pageSize'] = pageSize;
//        }else {
//            sendData['pageSize'] = 10;
//        }
//
//        var formData = {
//            type:'a',
//            mname:mname,
//            begintime:beginDate,
//            endtime:endDate,
//        };
//        //滚动加载
//        var nloader = LoadMore({
//            api: 'api/supply/materialGySelList.do',
//            data: formData,
//            success: function (data) {
//                data = data.data;
//                jsondata = data;
//
//
//                var html = '';
//                var model = '<dd><a id="open{{i}}"><h3>{{validate}}' +
//                    '{{rm_Code}}' +
//                    '</h3>' +
//                    '<div class="erp-txt">' +
//                    '                <p><span>项目名称:</span>{{proName}}</p>' +
//                    '            <p><span>施工单位:</span>{{compName1}}</p>' +
//                    '            <p><span>供货商名称:</span>{{supName}}</p>' +
//                    '            <p><span>送货地址:</span>{{r_adr}}</p>' +
//                    '            </div>' +
//                    '            </a>' +
//                    '            </dd>';
//                for (var i=0;i<data.length;i++){
//                    var modelt = model;
//                    if(data[i].validate == -1){
//                        modelt = modelt.replace('{{validate}}','<span class="btn btn-success fr">未签收</span>');
//                    }
//                    if(data[i].validate == 0){
//                        modelt = modelt.replace('{{validate}}','<span class="btn btn-warning fr">签收完成</span>');
//                    }
//                    if (data[i].validate == 2){
//                        modelt = modelt.replace('{{validate}}','<span class="btn btn-danger fr">拒绝签收</span>');
//                    }else {
//                        //容错
//                        modelt = modelt.replace('{{validate}}','');
//                    }
//
//                    modelt = modelt
//                        .replace('{{rm_Code}}', data[i].rm_Code)
//                        .replace('{{proName}}',data[i].proName)
//                        .replace('{{compName1}}',data[i].compName1)
//                        .replace('{{supName}}',data[i].supName)
//                        .replace('{{r_adr}}',data[i].r_adr)
//                        .replace('{{dataa}}',JSON.stringify(data[i]))
//                        .replace('{{i}}',i)
//                    html += modelt;
//                }
//
//                $('#list').html($('#list').html()+html);
//
//            }
//        })
//    }
//
//    $(document).on('click','a',function () {
//        var i = $(this).attr('id');
//        i = i.substring(4,i.length);
//        open(i);
//    })
//
//
//    function open(i) {
//        sessionStorage.setItem('lhr_clxq',JSON.stringify(jsondata[i]));
//        location.href = 'erp-details.html';
//    }
//    gundong(function(){
//        var n=1;
//        data(n,10);
//    }());

    // data(1,10);
</script>










